<!DOCTYPE html>
<title>document.contentType</title>
<link rel="help" href="https://dom.spec.whatwg.org/#dom-document-contenttype">
<script src="/js-test-resources/js-test.js"></script>
<body>
<p>
<iframe data-mt="text/css" src="../resources/dummy.css"></iframe>
<iframe data-mt="application/x-javascript" src="../resources/dummy.js"></iframe>
<iframe data-mt="text/html" src="../resources/dummy.html"></iframe>
<iframe data-mt="text/html" src="resources/send-mime-type.php"></iframe>
<iframe data-mt="text/xml" src="resources/send-mime-type.php?m=text/xml"></iframe>
<iframe data-mt="text/xml" src="resources/send-mime-type.php?m=text/xml;charset=utf-8"></iframe>
<iframe data-mt="text/html" src="javascript:&quot;hello world&quot;;"></iframe>
<iframe data-mt="text/html" src="about:blank"></iframe>
<iframe data-mt="text/plain" src="../resources/dummy.txt"></iframe>
<iframe data-mt="application/xml" src="../resources/dummy.xml"></iframe>
<iframe data-mt="image/bmp" src="../resources/square20.bmp"></iframe>
<iframe data-mt="image/gif" src="../resources/square20.gif"></iframe>
<iframe data-mt="image/jpeg" src="../resources/square20.jpg"></iframe>
<iframe data-mt="image/png" src="../resources/square20.png"></iframe>
</p>
<script>
var iframes;
window.onload = function() {
    iframes = document.getElementsByTagName('iframe');
    for (var k = 0; iframes[k]; k++) {
        shouldBeEqualToString('iframes[' + k + '].contentDocument.contentType',
                              iframes[k].dataset.mt);
        shouldBeEqualToString('iframes[' + k + '].contentDocument.cloneNode(false).contentType',
                              iframes[k].dataset.mt);
    }
};
</script>
